package com.pmcc.core.entity.security;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.pmcc.core.entity.UUIDEntity;
import com.pmcc.core.entity.enums.ModuleType;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * Created by syk on 17/7/6.
 */
@Entity
@Table(name = "SYS_AUTHORITY")
public class Authority extends UUIDEntity {



    @Column(name = "NAME")
    private String name;

    @Column(name = "code")
    private String code;

    @Column(name = "ICON")
    private String icon;//图标

    @Column(name = "ROUTER")
    private String router;//路由

    @Column(name = "PARENT_ID")
    private String parentId;//上级菜单-1为一级菜单

    @Column(name = "SORT_NO")
    private Integer sortNo;//排序编号

    @Column(name = "TYPE")
    @Enumerated(EnumType.STRING)
    private ModuleType moduleType;//类型 0菜单 1工具栏按钮 2请求 3行操作按钮 4页面按钮

    @Column(name = "CREATE_TIME")
    private Date createTime;//创建时间

    @Column(name = "IS_LEAF")
    private Boolean isLeaf;

    @Column(name = "PATH")
    private String path;//路径

    @Column(name = "INDEX_PATH")
    private String indexPath;//页面路径

   /* @JsonIgnore
    @ManyToMany(mappedBy = "authorities", fetch = FetchType.LAZY)
    private List<Role> roles;*/


    @Column(name = "CLICK_EVENT")
    private String clickEvent;

    public String getClickEvent() {
        return clickEvent;
    }

    public void setClickEvent(String clickEvent) {
        this.clickEvent = clickEvent;
    }

    public Boolean getLeaf() {
        return isLeaf;
    }

    public void setLeaf(Boolean leaf) {
        isLeaf = leaf;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getRouter() {
        return router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public ModuleType getModuleType() {
        return moduleType;
    }

    public void setModuleType(ModuleType moduleType) {
        this.moduleType = moduleType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

   /* public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }*/

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getIndexPath() {
        return indexPath;
    }

    public void setIndexPath(String indexPath) {
        this.indexPath = indexPath;
    }
}
